package com.example.star.contract;

import com.example.star.entity.User;

public interface UserContract {
    interface View {
        void showLoading();
        void hideLoading();
        void onLoginSuccess();
        void onLoginFailure(String message);
        void onRegisterSuccess();
        void onRegisterFailure(String message);
        void showPasswordMismatch();
        void showError(String message); //显示错误信息
    }

    interface Presenter {
        void login(User user);
        void register(User user);
    }

    interface Model {
        interface OnLoginListener {
            void onSuccess();
            void onFailure(String message);
        }

        interface OnRegisterListener {
            void onSuccess();
            void onFailure(String message);
        }

        void login(User user, OnLoginListener listener);
        void register(User user, OnRegisterListener listener);
    }
}
